package com.star.files.enums;

import com.star.common.base.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 文件分类枚举
 *
 * @author yangzj
 */
@AllArgsConstructor
@Getter
public enum FileCategory implements BaseEnum<String> {

    /**
     * 文件分类
     */
    OTHER("other", "其他"),
    USER("user", "用户"),
    ;
    private final String code;
    private final String name;

    public static boolean contains(String code) {
        for (FileCategory fileCategory : FileCategory.values()) {
            if (fileCategory.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }

    @Override
    public String getTypeCode() {
        return "file_category";
    }

    @Override
    public String getTypeName() {
        return "文件分类";
    }
}
